<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>player</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;player
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="player-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="player-module.html">Module player</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: utf8 -*-</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module enemy=enemy-module.html"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-0', 'enemy', 'link-0');">enemy</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Class enemy.Enemy=enemy.Enemy-class.html"><a title="enemy.Enemy" class="py-name" href="#" onclick="return doclink('link-1', 'Enemy', 'link-1');">Enemy</a></tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-2" class="py-name" targets="Module skill=skill-module.html"><a title="skill" class="py-name" href="#" onclick="return doclink('link-2', 'skill', 'link-2');">skill</a></tt> <tt class="py-keyword">import</tt> <tt id="link-3" class="py-name" targets="Class skill.Skill=skill.Skill-class.html"><a title="skill.Skill" class="py-name" href="#" onclick="return doclink('link-3', 'Skill', 'link-3');">Skill</a></tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-4" class="py-name" targets="Module equipment=equipment-module.html"><a title="equipment" class="py-name" href="#" onclick="return doclink('link-4', 'equipment', 'link-4');">equipment</a></tt> <tt class="py-keyword">import</tt> <tt id="link-5" class="py-name" targets="Class equipment.Equipment=equipment.Equipment-class.html"><a title="equipment.Equipment" class="py-name" href="#" onclick="return doclink('link-5', 'Equipment', 'link-5');">Equipment</a></tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">random</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"> </tt>
<a name="Player"></a><div id="Player-def"><a name="L7"></a><tt class="py-lineno"> 7</tt> <a class="py-toggle" href="#" id="Player-toggle" onclick="return toggle('Player');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="player.Player-class.html">Player</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="Player-expanded"><a name="Player.__init__"></a><div id="Player.__init__-def"><a name="L8"></a><tt class="py-lineno"> 8</tt> <a class="py-toggle" href="#" id="Player.__init__-toggle" onclick="return toggle('Player.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">mhp</tt><tt class="py-op">,</tt><tt class="py-param">hp</tt><tt class="py-op">,</tt><tt class="py-param">mov</tt><tt class="py-op">=</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-param">atk</tt><tt class="py-op">=</tt><tt class="py-number">10</tt><tt class="py-op">,</tt><tt class="py-param">defend</tt><tt class="py-op">=</tt><tt class="py-number">5</tt><tt class="py-op">,</tt><tt class="py-param">exp</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">=</tt><tt class="py-string">'ppl'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.__init__-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.__init__-expanded"><a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mhp</tt><tt class="py-op">=</tt><tt class="py-name">mhp</tt>   <tt class="py-comment"># &#26368;&#22823;HP</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">hp</tt><tt class="py-op">=</tt><tt class="py-name">hp</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mov</tt><tt class="py-op">=</tt><tt class="py-name">mov</tt>   <tt class="py-comment"># your move</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">atk</tt><tt class="py-op">=</tt><tt class="py-name">atk</tt>  <tt class="py-comment"># your atk</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">defend</tt><tt class="py-op">=</tt><tt class="py-name">defend</tt>    <tt class="py-comment"># your defend</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">atk_add</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt>  <tt class="py-comment"># your bangkill</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">exp</tt> <tt class="py-op">=</tt> <tt class="py-name">exp</tt> <tt class="py-comment"># &#20154;&#29289;&#32463;&#39564;</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">name</tt> <tt class="py-op">=</tt> <tt class="py-name">name</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mround</tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> <tt class="py-comment"># &#21508;&#31181;&#34892;&#20026;&#28040;&#32791;&#20540;</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">newAtk</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">atk</tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">newDefend</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">defend</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">hp</tt><tt class="py-op">&gt;</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mhp</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">hp</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mhp</tt> </tt>
</div><a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line">     </tt>
<a name="Player.getLevel"></a><div id="Player.getLevel-def"><a name="L22"></a><tt class="py-lineno">22</tt> <a class="py-toggle" href="#" id="Player.getLevel-toggle" onclick="return toggle('Player.getLevel');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#getLevel">getLevel</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.getLevel-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.getLevel-expanded"><a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">        <tt class="py-docstring">'''&#33719;&#21462;&#20154;&#29289;&#31561;&#32423;'''</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">exp</tt><tt class="py-op">/</tt><tt class="py-number">100</tt><tt class="py-op">+</tt><tt class="py-number">1</tt> </tt>
</div><a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line">    <tt id="link-6" class="py-name" targets="Variable player.Player.heroLV=player.Player-class.html#heroLV"><a title="player.Player.heroLV" class="py-name" href="#" onclick="return doclink('link-6', 'heroLV', 'link-6');">heroLV</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-7" class="py-name" targets="Method player.Player.getLevel()=player.Player-class.html#getLevel"><a title="player.Player.getLevel" class="py-name" href="#" onclick="return doclink('link-7', 'getLevel', 'link-7');">getLevel</a></tt><tt class="py-op">)</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line"> </tt>
<a name="Player.equip"></a><div id="Player.equip-def"><a name="L27"></a><tt class="py-lineno">27</tt> <a class="py-toggle" href="#" id="Player.equip-toggle" onclick="return toggle('Player.equip');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#equip">equip</a> <tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">equipment</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.equip-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.equip-expanded"><a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-8" class="py-name"><a title="equipment" class="py-name" href="#" onclick="return doclink('link-8', 'equipment', 'link-4');">equipment</a></tt><tt class="py-op">.</tt><tt class="py-name">owner</tt><tt class="py-op">==</tt><tt class="py-number">0</tt> <tt class="py-keyword">and</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name"><a title="player.Player.heroLV" class="py-name" href="#" onclick="return doclink('link-9', 'heroLV', 'link-6');">heroLV</a></tt><tt class="py-op">&gt;=</tt><tt id="link-10" class="py-name"><a title="equipment" class="py-name" href="#" onclick="return doclink('link-10', 'equipment', 'link-4');">equipment</a></tt><tt class="py-op">.</tt><tt class="py-name">lv</tt><tt class="py-op">:</tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">newAtk</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">atk</tt><tt class="py-op">+</tt><tt id="link-11" class="py-name"><a title="equipment" class="py-name" href="#" onclick="return doclink('link-11', 'equipment', 'link-4');">equipment</a></tt><tt class="py-op">.</tt><tt class="py-name">atk</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">newDefend</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">defend</tt><tt class="py-op">+</tt><tt id="link-12" class="py-name"><a title="equipment" class="py-name" href="#" onclick="return doclink('link-12', 'equipment', 'link-4');">equipment</a></tt><tt class="py-op">.</tt><tt class="py-name">defend</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line">            <tt id="link-13" class="py-name"><a title="equipment" class="py-name" href="#" onclick="return doclink('link-13', 'equipment', 'link-4');">equipment</a></tt><tt class="py-op">.</tt><tt class="py-name">owner</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
</div><a name="Player.useItem"></a><div id="Player.useItem-def"><a name="L34"></a><tt class="py-lineno">34</tt> <a class="py-toggle" href="#" id="Player.useItem-toggle" onclick="return toggle('Player.useItem');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#useItem">useItem</a> <tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">item</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.useItem-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.useItem-expanded"><a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">hp</tt> <tt class="py-op">+=</tt> <tt id="link-14" class="py-name" targets="Module item=item-module.html"><a title="item" class="py-name" href="#" onclick="return doclink('link-14', 'item', 'link-14');">item</a></tt><tt class="py-op">.</tt><tt class="py-name">hp</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">atk</tt> <tt class="py-op">+=</tt> <tt id="link-15" class="py-name"><a title="item" class="py-name" href="#" onclick="return doclink('link-15', 'item', 'link-14');">item</a></tt><tt class="py-op">.</tt><tt class="py-name">atk</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mov</tt> <tt class="py-op">+=</tt> <tt id="link-16" class="py-name"><a title="item" class="py-name" href="#" onclick="return doclink('link-16', 'item', 'link-14');">item</a></tt><tt class="py-op">.</tt><tt class="py-name">mov</tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">defend</tt> <tt class="py-op">+=</tt> <tt id="link-17" class="py-name"><a title="item" class="py-name" href="#" onclick="return doclink('link-17', 'item', 'link-14');">item</a></tt><tt class="py-op">.</tt><tt class="py-name">defend</tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mround</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mround</tt> <tt class="py-op">-</tt> <tt class="py-number">2</tt> <tt class="py-comment">#&#35745;&#31639;&#34892;&#20026;&#20540;</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">hp</tt><tt class="py-op">&gt;</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mhp</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">hp</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mhp</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">        <tt class="py-keyword">del</tt> <tt id="link-18" class="py-name"><a title="item" class="py-name" href="#" onclick="return doclink('link-18', 'item', 'link-14');">item</a></tt> </tt>
</div><a name="Player.isBang"></a><div id="Player.isBang-def"><a name="L42"></a><tt class="py-lineno">42</tt> <a class="py-toggle" href="#" id="Player.isBang-toggle" onclick="return toggle('Player.isBang');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#isBang">isBang</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.isBang-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.isBang-expanded"><a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">        <tt class="py-docstring">'''&#21028;&#26029;&#26159;&#21542;&#21457;&#29983;&#20102;&#26292;&#20987;&#30340;&#26041;&#27861;'''</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">random</tt><tt class="py-op">.</tt><tt class="py-name">randint</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">1000</tt><tt class="py-op">)</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">51</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
</div><a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">     </tt>
<a name="Player.bang"></a><div id="Player.bang-def"><a name="L48"></a><tt class="py-lineno">48</tt> <a class="py-toggle" href="#" id="Player.bang-toggle" onclick="return toggle('Player.bang');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#bang">bang</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">enemy</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.bang-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.bang-expanded"><a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line">        <tt class="py-docstring">'''&#26292;&#20987;'''</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">atk_add</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">newAtk</tt><tt class="py-op">*</tt><tt class="py-number">0.5</tt><tt class="py-op">)</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name" targets="Method player.Player.realAttack()=player.Player-class.html#realAttack"><a title="player.Player.realAttack" class="py-name" href="#" onclick="return doclink('link-19', 'realAttack', 'link-19');">realAttack</a></tt><tt class="py-op">(</tt><tt id="link-20" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-20', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line">         </tt>
<a name="Player.normalAttack"></a><div id="Player.normalAttack-def"><a name="L53"></a><tt class="py-lineno">53</tt> <a class="py-toggle" href="#" id="Player.normalAttack-toggle" onclick="return toggle('Player.normalAttack');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#normalAttack">normalAttack</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">enemy</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.normalAttack-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.normalAttack-expanded"><a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line">        <tt class="py-docstring">'''&#26222;&#36890;&#25915;&#20987;'''</tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">atk_add</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="player.Player.realAttack" class="py-name" href="#" onclick="return doclink('link-21', 'realAttack', 'link-19');">realAttack</a></tt><tt class="py-op">(</tt><tt id="link-22" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-22', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">)</tt> </tt>
</div><a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line"> </tt>
<a name="Player.attack"></a><div id="Player.attack-def"><a name="L58"></a><tt class="py-lineno">58</tt> <a class="py-toggle" href="#" id="Player.attack-toggle" onclick="return toggle('Player.attack');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#attack">attack</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">enemy</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.attack-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.attack-expanded"><a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line">        <tt class="py-docstring">'''&#35745;&#31639;&#20135;&#29983;&#20309;&#31181;&#25915;&#20987;&#26041;&#24335;'''</tt> </tt>
<a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Method player.Player.isBang()=player.Player-class.html#isBang"><a title="player.Player.isBang" class="py-name" href="#" onclick="return doclink('link-23', 'isBang', 'link-23');">isBang</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line">            <tt class="py-name">hp</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name" targets="Method player.Player.bang()=player.Player-class.html#bang"><a title="player.Player.bang" class="py-name" href="#" onclick="return doclink('link-24', 'bang', 'link-24');">bang</a></tt><tt class="py-op">(</tt><tt id="link-25" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-25', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">)</tt> </tt>
<a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mround</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mround</tt><tt class="py-op">-</tt><tt class="py-number">2</tt> <tt class="py-comment">#&#35745;&#31639;&#34892;&#20026;&#20540;</tt> </tt>
<a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">hp</tt><tt class="py-op">,</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L64"></a><tt class="py-lineno">64</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L65"></a><tt class="py-lineno">65</tt>  <tt class="py-line">            <tt class="py-name">hp</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-26" class="py-name" targets="Method player.Player.normalAttack()=player.Player-class.html#normalAttack"><a title="player.Player.normalAttack" class="py-name" href="#" onclick="return doclink('link-26', 'normalAttack', 'link-26');">normalAttack</a></tt><tt class="py-op">(</tt><tt id="link-27" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-27', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">)</tt> </tt>
<a name="L66"></a><tt class="py-lineno">66</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mround</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">mround</tt><tt class="py-op">-</tt><tt class="py-number">2</tt> <tt class="py-comment">#&#35745;&#31639;&#34892;&#20026;&#20540;</tt> </tt>
<a name="L67"></a><tt class="py-lineno">67</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">hp</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
</div><a name="L68"></a><tt class="py-lineno">68</tt>  <tt class="py-line">             </tt>
<a name="Player.realAttack"></a><div id="Player.realAttack-def"><a name="L69"></a><tt class="py-lineno">69</tt> <a class="py-toggle" href="#" id="Player.realAttack-toggle" onclick="return toggle('Player.realAttack');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#realAttack">realAttack</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">enemy</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.realAttack-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.realAttack-expanded"><a name="L70"></a><tt class="py-lineno">70</tt>  <tt class="py-line">        <tt class="py-docstring">'''&#26681;&#25454;&#20844;&#24335;&#30495;&#23454;&#25915;&#20987;'''</tt> </tt>
<a name="L71"></a><tt class="py-lineno">71</tt>  <tt class="py-line">        <tt class="py-name">damage</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">newAtk</tt><tt class="py-op">+</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">atk_add</tt><tt class="py-op">-</tt><tt id="link-28" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-28', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">.</tt><tt class="py-name">defend</tt> </tt>
<a name="L72"></a><tt class="py-lineno">72</tt>  <tt class="py-line">        <tt id="link-29" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-29', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">.</tt><tt class="py-name">hp</tt><tt class="py-op">=</tt><tt id="link-30" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-30', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">.</tt><tt class="py-name">hp</tt><tt class="py-op">-</tt><tt class="py-name">damage</tt> </tt>
<a name="L73"></a><tt class="py-lineno">73</tt>  <tt class="py-line">         </tt>
<a name="L74"></a><tt class="py-lineno">74</tt>  <tt class="py-line">        <tt id="link-31" class="py-name"><a title="skill" class="py-name" href="#" onclick="return doclink('link-31', 'skill', 'link-2');">skill</a></tt> <tt class="py-op">=</tt> <tt id="link-32" class="py-name"><a title="skill.Skill" class="py-name" href="#" onclick="return doclink('link-32', 'Skill', 'link-3');">Skill</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt><tt id="link-33" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-33', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">)</tt> <tt class="py-comment"># &#32463;&#39564;&#27169;&#22359;</tt> </tt>
<a name="L75"></a><tt class="py-lineno">75</tt>  <tt class="py-line">         </tt>
<a name="L76"></a><tt class="py-lineno">76</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-34" class="py-name"><a title="enemy" class="py-name" href="#" onclick="return doclink('link-34', 'enemy', 'link-0');">enemy</a></tt><tt class="py-op">.</tt><tt class="py-name">hp</tt> </tt>
</div><a name="L77"></a><tt class="py-lineno">77</tt>  <tt class="py-line"> </tt>
<a name="Player.isOver"></a><div id="Player.isOver-def"><a name="L78"></a><tt class="py-lineno">78</tt> <a class="py-toggle" href="#" id="Player.isOver-toggle" onclick="return toggle('Player.isOver');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="player.Player-class.html#isOver">isOver</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Player.isOver-collapsed" style="display:none;" pad="++" indent="++++++++"></div><div id="Player.isOver-expanded"><a name="L79"></a><tt class="py-lineno">79</tt>  <tt class="py-line">        <tt class="py-docstring">'''&#21028;&#26029;&#33258;&#24049;&#26159;&#21542;&#24050;&#32463;&#27515;&#20129;'''</tt> </tt>
<a name="L80"></a><tt class="py-lineno">80</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt> <tt class="py-string">'HP:'</tt> <tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">hp</tt> </tt>
<a name="L81"></a><tt class="py-lineno">81</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">hp</tt><tt class="py-op">&lt;=</tt><tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L82"></a><tt class="py-lineno">82</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt> <tt class="py-string">'you dead'</tt> </tt>
<a name="L83"></a><tt class="py-lineno">83</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">True</tt> </tt>
<a name="L84"></a><tt class="py-lineno">84</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">False</tt> </tt>
</div></div><a name="L85"></a><tt class="py-lineno">85</tt>  <tt class="py-line">     </tt>
<a name="L86"></a><tt class="py-lineno">86</tt>  <tt class="py-line">    <tt class="py-comment">#&#27492;&#26041;&#27861;&#22833;&#25928;&#65292;&#26242;&#26102;&#21462;&#28040;</tt> </tt>
<a name="L87"></a><tt class="py-lineno">87</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#def isRoundOver(self):</tt> </tt>
<a name="L88"></a><tt class="py-lineno">88</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    '''&#21028;&#26029;&#33258;&#24049;&#30340;&#22238;&#21512;&#20869;&#36824;&#33021;&#21542;&#32487;&#32493;&#34892;&#21160;'''</tt> </tt>
<a name="L89"></a><tt class="py-lineno">89</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    if mround == 0:</tt> </tt>
<a name="L90"></a><tt class="py-lineno">90</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#        mround = 2</tt> </tt>
<a name="L91"></a><tt class="py-lineno">91</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#        return True</tt> </tt>
<a name="L92"></a><tt class="py-lineno">92</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    return False</tt> </tt>
<a name="L93"></a><tt class="py-lineno">93</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Fri Dec  5 00:20:12 2008
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
